/*
 * @lc app=leetcode.cn id=26 lang=java
 *
 * [26] 删除有序数组中的重复项
 */

// @lc code=start
class Solution {
    public int removeDuplicates(int[] nums) {
        int start=0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[start]==nums[i]) {
                continue;
            } else {
                nums[++start]=nums[i];
            }            
        }
        return start+1;
    }
}
// @lc code=end

